package com.ebraga.trackerclub.android.handler.api;

import java.util.Date;
import java.util.List;

import com.ebraga.trackerclub.android.exception.handler.BackofficeHandlerException;
import com.ebraga.trackerclub.android.vo.CheckInOutVO;
import com.ebraga.trackerclub.android.vo.PositionVO;
import com.ebraga.trackerclub.android.vo.UserVO;

public interface CheckInOutHandler {
	
	
	/**
	 * Method responsible for starting work
	 *
	 * @param PositionVO
	 * @return Long - ID from inserted record or -1 on failure
	 * 
	 * @throws BackofficeHandlerException 
	 */
	Long checkIn(PositionVO positionVo) throws BackofficeHandlerException;
	
	/**
	 * Method responsible for finishing work
	 *
	 * @param PositionVO
	 * @return Long - ID from inserted record or -1 on failure
	 * 
	 * @throws BackofficeHandlerException 
	 */
	Long checkOut(PositionVO positionVo) throws BackofficeHandlerException;
	
	/**
	 * Checks if the user is working
	 * 
	 * @param userSession
	 * @return Boolean - true if checkIn is open
	 * 
	 * @throws BackofficeHandlerException
	 */
	Boolean verifyCheckInOpen(UserVO userSession) throws BackofficeHandlerException;
	
	/**
	 * Method responsible for returning the history of check in and check out of the employee.
	 * 
	 * @param login
	 * @param startDate
	 * @param endDate
	 * @return List<CheckInOutVO>
	 * 
	 * @throws BackofficeHandlerException
	 */
	List<CheckInOutVO> retrieveHistoryCheckInOut(String login, Date startDate, Date endDate) throws BackofficeHandlerException;	
	
	/**
	 * Return last status, Check In or Check Out
	 * 
	 * @param login
	 * @return CheckInOutVO
	 * 
	 * @throws BackofficeHandlerException
	 */
	CheckInOutVO lastStatusCheckInOut(String login) throws BackofficeHandlerException;
	
}
